package csc.daonjpa.java.domain;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="customer")
public class Customer implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	 @Id
	 @Column(name="loginId")
	 private String loginId;
	 
	 @Column(name="password")
	 private String password;
	 
	 @Column(name="firstname")
	 private String firstname;
	 
	 @Column(name="lastname")
	 private String lastname;
	 
	 @Column(name="address")
	 private String address;
	 
	 @Column(name="phone")
	 private String phone;
	 
	 @OneToMany(mappedBy="customer")
	 private Collection<Account> accounts;
	 
	 @OneToMany(mappedBy="customer")
	 private Collection<Card> cards;

	 public Customer(){
		 
	 }
	public Customer(String loginId, String password, String firstname,
			String lastname, String address, String phone,
			Collection<Account> accounts) {
		super();
		this.loginId = loginId;
		this.password = password;
		this.firstname = firstname;
		this.lastname = lastname;
		this.address = address;
		this.phone = phone;
		this.accounts = accounts;
	}

	public String getLoginId() {
		return loginId;
	}

	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public Collection<Account> getAccounts() {
		return accounts;
	}

	public void setAccounts(Collection<Account> accounts) {
		this.accounts = accounts;
	}
	 
	 
}
